﻿@model IEnumerable<CID.Domain.Infrastructure.Template>

@{
    ViewBag.Title = "Templates' Index";
}

<h2>Templates</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Type
        </th>
        <th>
            Purpose
        </th>
        <th>
            Name
        </th>
        <th>
            Description
        </th>
        <th>
            Enabled
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Type.Name)
        </td>
        <td>
            @*TODO: get the purpose of the Template (Activation, Deactivation, Deployment)*@
            @Html.DisplayFor(modelItem => item.GetType().Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Enabled)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
            @Html.ActionLink("Create Copy", "CreateCopy", new { originalId = item.Id }) |
            @Html.ActionLink("Details", "Details", new { id = item.Id })
        </td>
    </tr>
}

</table>
